package ncrnadb.core;

import java.util.Map;
import java.util.TreeMap;


/**
 * 
 * Implementation of Biological Entity Type.
 * 
 * @author vbonnici
 *
 */
public enum EntityType {

	OTHERS("OTHERS"),
	NCRNA("NCRNA"),
	RNA("RNA"),
	GENE("GENE"),
	DISEASE("DISEASE");
	
	public String type;
	private EntityType(String type){
		this.type = type;
	}
	
	
	/**
	 * Maps entity types to their descriptive string.
	 */
	public final static Map<String,EntityType> rmap = new TreeMap<String,EntityType>();
	static{
		for(EntityType t : EntityType.values()){
			rmap.put(t.type, t);
		}
	}
	
	
	/**
	 * Get an EntityType by its descriptive string name.
	 * 
	 * @param type
	 * @return
	 */
	public static EntityType getByType(String type){
		return rmap.get(type);
	}
}
